﻿using System;
using UnityEngine;

// Token: 0x020002D8 RID: 728
public static class PhysicsHelper
{
	// Token: 0x060010F0 RID: 4336 RVA: 0x0007D254 File Offset: 0x0007B454
	public static bool CapsuleCast(CapsuleCollider capsule, Vector3 direction)
	{
		Vector3 point;
		Vector3 point2;
		float radius;
		PhysicsHelper.ProcessCapsule(capsule, out point, out point2, out radius);
		return Physics.CapsuleCast(point, point2, radius, direction);
	}

	// Token: 0x060010F1 RID: 4337 RVA: 0x0007D278 File Offset: 0x0007B478
	public static bool CapsuleCast(CapsuleCollider capsule, Vector3 direction, float maxDistance)
	{
		Vector3 point;
		Vector3 point2;
		float radius;
		PhysicsHelper.ProcessCapsule(capsule, out point, out point2, out radius);
		return Physics.CapsuleCast(point, point2, radius, direction, maxDistance);
	}

	// Token: 0x060010F2 RID: 4338 RVA: 0x0007D29C File Offset: 0x0007B49C
	public static bool CapsuleCast(CapsuleCollider capsule, Vector3 direction, out RaycastHit hitInfo)
	{
		Vector3 point;
		Vector3 point2;
		float radius;
		PhysicsHelper.ProcessCapsule(capsule, out point, out point2, out radius);
		return Physics.CapsuleCast(point, point2, radius, direction, out hitInfo);
	}

	// Token: 0x060010F3 RID: 4339 RVA: 0x0007D2C0 File Offset: 0x0007B4C0
	public static bool CapsuleCast(CapsuleCollider capsule, Vector3 direction, float maxDistance, LayerMask layerMask)
	{
		Vector3 point;
		Vector3 point2;
		float radius;
		PhysicsHelper.ProcessCapsule(capsule, out point, out point2, out radius);
		return Physics.CapsuleCast(point, point2, radius, direction, maxDistance, layerMask);
	}

	// Token: 0x060010F4 RID: 4340 RVA: 0x0007D2EC File Offset: 0x0007B4EC
	public static bool CapsuleCast(CapsuleCollider capsule, Vector3 direction, out RaycastHit hitInfo, float maxDistance)
	{
		Vector3 point;
		Vector3 point2;
		float radius;
		PhysicsHelper.ProcessCapsule(capsule, out point, out point2, out radius);
		return Physics.CapsuleCast(point, point2, radius, direction, out hitInfo, maxDistance);
	}

	// Token: 0x060010F5 RID: 4341 RVA: 0x0007D310 File Offset: 0x0007B510
	public static bool CapsuleCast(CapsuleCollider capsule, Vector3 direction, out RaycastHit hitInfo, float maxDistance, LayerMask layerMask)
	{
		Vector3 point;
		Vector3 point2;
		float radius;
		PhysicsHelper.ProcessCapsule(capsule, out point, out point2, out radius);
		return Physics.CapsuleCast(point, point2, radius, direction, out hitInfo, maxDistance, layerMask);
	}

	// Token: 0x060010F6 RID: 4342 RVA: 0x0007D33C File Offset: 0x0007B53C
	public static void ProcessCapsule(CapsuleCollider capsule, out Vector3 p1, out Vector3 p2, out float r)
	{
		Vector3[] array = new Vector3[]
		{
			Vector3.left,
			Vector3.up,
			Vector3.forward
		};
		Vector3 a = array[capsule.direction];
		Transform transform = capsule.transform;
		p1 = transform.position + transform.rotation * (capsule.center + a * (capsule.height / 2f - capsule.radius - 0.1f)) * transform.lossyScale.y;
		p2 = transform.position + transform.rotation * (capsule.center - a * (capsule.height / 2f - capsule.radius - 0.1f)) * transform.lossyScale.y;
		r = capsule.radius * transform.lossyScale.y;
	}
}
